<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>添加部门</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" href="easyui/themes/default/easyui.css"
		type="text/css"></link>
	<link rel="stylesheet" href="easyui/themes/icon.css" type="text/css"></link>
	<script type="text/javascript" src="easyui/jquery.min.js"></script>
	<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript">
	$(function() {
			/*********************保存事件********************************/
		$("#btsave").click(function(){
			$.messager.progress();	// 显示进度条
			$('#ff').form('submit', {
				url: 'save_Dep.action',
				onSubmit: function(){
					var isValid = $(this).form('validate');
					if (!isValid){
						$.messager.progress('close');	// 如果表单是无效的则隐藏进度条
					}
					return isValid;	// 返回false终止表单提交
				},
				success: function(code){
					$.messager.progress('close');	// 如果提交成功则隐藏进度条
					if(code=='1'){
						$.messager.alert('提示','保存成功！');
						$('#dg').datagrid('reload');    // 重新载入当前页面数据  

					}else{
						$.messager.alert('提示','保存失败！');
					}
				}
			});


		});
		/***********************************************************/
	});
		
	</script>
  </head>
  
  <body>
   <p align="center">部门添加</p>
<hr/>
<div align="center">
		<form id="ff" method="post">
			<table>
			<tr align="left">
				<td>
					<label for="name">部门:</label> 
				</td>
				<td>
				<input type="hidden" name="dep.depid"/>
				<input class="easyui-validatebox" type="text" name="dep.depname" data-options="required:true" />
				</td>	
			</tr>
			<tr align="left">
				<td>
					<label for="name">负责人:</label> 
				</td>
				<td>
				<input class="easyui-validatebox" type="text" name="dep.uname" data-options="required:true" />
				</td>	
			</tr>
			
			<tr align="center">
				<td colspan="2">
					<input type="button" id="btsave" value="保存" /> 
					<input type="reset" value="重置" /> 
				</td>
			</tr>
			</table>
		</form>
	</div> 
  </body>
</html>
